package lhy.autoparts.pojo;

import lhy.frontend.annotation.EntityComment;
import lhy.orm.Serializer;
import lhy.orm.annotation.Column;
import lhy.lhyorm.field.DatabaseField;
import lhy.lhyorm.table.DatabaseTable;

import java.io.Serializable;

/**
 * 商品信息实体
 */
@DatabaseTable(tableName = "ItemInfo")
@EntityComment("商品信息")
public class ItemInfo implements Serializable {

	@Column("商品编号")
	@DatabaseField(id =true)
	public String  id;
	@Column("商品名称")
	@DatabaseField public String  name;
	@Column("商品型号")
	@DatabaseField public String  model;
	@Column("商品类别")
	@DatabaseField(foreign=true  )
	public ItemCategory cate;
	@Column("商品单位")
	@DatabaseField(foreign=true  )
	public ItemUnit unit;
	@Column("成本均价")@DatabaseField
	public double avgCost;
	@Column("销售价格")@DatabaseField
	public double sellPrice;
	/*@Column("上次进价")@DatabaseField
	public double prevCost;*/
	/*@Column("库存数量")@DatabaseField
	public int amount;*/

	@Column("供应商")
	@DatabaseField(foreign=true  )
	public Supplier supplier;
	/*@Column("状态")@DatabaseField
	@SimpleMapping("2=货源充足,1=货源短缺,0=无货")
	public char state;*/
	@Column("备注")
	@DatabaseField public String  comment;
	@Override
	public String toString() {
		return Serializer.doSerialize(this);
	}
}